<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>scroll属性</title>
    <style>
        body{
            width: 2000px;
            height: 2000px;
        }
        div{
            width: 200px;
            height: 200px;
            border: 1px solid red;
            overflow: auto;
        }
        .img{
            width: 400px;
            height: 400px;
        }
    </style>
</head>
<body>
<input type="button" value="按钮" id="btn">
<div>
    <div class="img"></div>
</div>
</body>
<script src="jquery-3.3.1.min.js"></script>
<script>
    $(function () {
        $('#btn').click(function () {
            console.log($('div').scrollLeft() + ':' + $('div').scrollTop());
            $('div').scrollLeft(160);   // 设置元素内容被卷曲的宽度
            $(window).scrollLeft(160);
        })
    })
</script>
</html>